<template>
  <div id="app"  v-bind:style="appDivStyle">
      <div class="context" ref="context">
           <div class="queryBox" ref="queryBox">
                <el-form :model="formQueryCondition"
                         ref="form" size="mini">
                    <!--查询条件-->
                    <!--资产编号-->
                  <el-row>
                    <el-col :span="5">
                      <el-form-item :label="$t('assetsAudit.queryLabel.assetCode')"  :label-width="queryformLabelWidth"  >
                        <el-input v-model.trim="formQueryCondition.assetCode.val" class="queryItemStyle" clearable
                                  :placeholder="$t('assetsAudit.queryLabel.placeholderAssetCode')"></el-input>
                    </el-form-item>
                    </el-col>
                    <!--资产名称-->
                    <el-col :span="5" :offset="1">
                      <el-form-item :label="$t('assetsAudit.queryLabel.assetName')"   :label-width="queryformLabelWidth">
                          <el-input v-model.trim="formQueryCondition.assetName.val" class="queryItemStyle" clearable
                                    :placeholder="$t('assetsAudit.queryLabel.placeholderAssetName')">
                          </el-input>
                      </el-form-item>
                    </el-col>
                     <!--资产类型-->
                    <el-col :span="5" :offset="1">
                      <el-form-item :label="$t('shellAssets.queryLabel.shellAssets.type')"  :label-width="queryformLabelWidth">
                          <el-select v-model="formQueryCondition.assetType.val" class="queryItemStyle">
                              <el-option :label="$t('shellAssets.label.all')" value=""></el-option>
                              <el-option :value="drug.valueCode" :key="drug.valueCode" :label="drug.valueText"
                                  v-for="drug in typeData"></el-option>
                              <!-- <el-option :label="$t('shellAssets.label.shellAssetsType1')" :value="$t('shellAssets.label.shellAssetsType1')"></el-option>
                              <el-option :label="$t('shellAssets.label.shellAssetsType2')" :value="$t('shellAssets.label.shellAssetsType2')"></el-option>
                              <el-option :label="$t('shellAssets.label.shellAssetsType3')" :value="$t('shellAssets.label.shellAssetsType3')"></el-option>
                              <el-option :label="$t('shellAssets.label.shellAssetsType4')" :value="$t('shellAssets.label.shellAssetsType4')"></el-option> -->
                          </el-select>
                      </el-form-item>
                    </el-col>
                    <!--资产来源-->
                    <el-col :span="5" :offset="1">
                      <el-form-item :label="$t('shellAssets.queryLabel.shellAssets.source')"  :label-width="queryformLabelWidth">
                        <el-select v-model="formQueryCondition.assetSource.val" class="queryItemStyle">
                          <el-option :label="$t('shellAssets.label.all')" value=""></el-option>
                          <el-option :value="drug.keyId" :key="drug.keyId" :label="drug.speAreaName"
                              v-for="drug in source"></el-option>
                        </el-select>
                      </el-form-item>
                    </el-col>
                     <!--标签-->
                    <!-- <el-col :span="5" :offset="1">
                      <el-form-item :label="$t('shellAssets.queryLabel.shellAssets.tag')"  :label-width="queryformLabelWidth">
                          <el-select v-model="formQueryCondition.tag.val" class="queryItemStyle">
                              <el-option :label="$t('shellAssets.label.all')" value=""></el-option>
                              <el-option :value="drug.keyId" :key="drug.keyId" :label="drug.tagName"
                                  v-for="drug in LabelGroups"></el-option>
                          </el-select>
                      </el-form-item>
                    </el-col> -->
                  </el-row>
                     <!--资产分类-->
                    <!-- <el-form-item :label="$t('shellAssets.queryLabel.shellAssets.sort')"  :label-width="queryformLabelWidth">
                        <el-select v-model="formQueryCondition.sort.val" class="queryItemStyle">
                            <el-option :label="$t('shellAssets.label.all')" value=""></el-option>
                            <el-option :value="item.capitalCode" :key="item.capitalCode" :label="item.capitalName"
                                v-for="item in sort"></el-option>
                        </el-select>
                    </el-form-item> -->
                     <!--资产分类-->
                    <!-- <el-form-item :label="$t('shellAssets.queryLabel.shellAssets.sort')"  :label-width="queryformLabelWidth">
                        <el-select v-model="formQueryCondition.sort.val" class="queryItemStyle">
                            <el-option :label="$t('shellAssets.label.all')" value=""></el-option>
                            <el-option :label="$t('shellAssets.label.shellAssetsType1')" value="shellAssetsType1"></el-option>
                            <el-option :label="$t('shellAssets.label.shellAssetsType2')" value="shellAssetsType2"></el-option>
                            <el-option :label="$t('shellAssets.label.shellAssetsType3')" value="shellAssetsType3"></el-option>
                            <el-option :label="$t('shellAssets.label.shellAssetsType4')" value="shellAssetsType4"></el-option>
                        </el-select>
                    </el-form-item> -->
                    <!--资产提供方-->
                  <el-row>
                    <el-col :span="5">
                      <el-form-item :label="$t('shellAssets.queryLabel.shellAssets.sourceInfo')"   :label-width="queryformLabelWidth">
                        <el-select v-model="formQueryCondition.assetProvider.val" class="queryItemStyle">
                          <el-option :label="$t('shellAssets.label.all')" value=""></el-option>
                          <el-option :value="drug.keyId" :key="drug.keyId" :label="drug.providerName"
                              v-for="drug in AssetProvision"></el-option>
                        </el-select>
                      </el-form-item>
                    </el-col>


                    <!--审核状态-->
                      <el-col :span="5" :offset="1">
                    <el-form-item :label="$t('shellAssets.queryLabel.shellAssets.status')"  :label-width="queryformLabelWidth">
                      <el-select v-model="formQueryCondition.assetState.val" class="queryItemStyle">
                        <el-option :label="$t('shellAssets.label.all')" value=""></el-option>
                        <el-option :value="drug.valueCode" :key="drug.valueCode" :label="drug.valueText"
                            v-for="drug in ApprovalStatus"></el-option>
                        <!-- <el-option :label="$t('shellAssets.label.shellAssetsStatus1')" value="shellAssetsStatus1"></el-option>
                        <el-option :label="$t('shellAssets.label.shellAssetsStatus2')" value="shellAssetsStatus2"></el-option>
                        <el-option :label="$t('shellAssets.label.shellAssetsStatus3')" value="shellAssetsStatus3"></el-option>
                        <el-option :label="$t('shellAssets.label.shellAssetsStatus4')" value="shellAssetsStatus4"></el-option> -->
                      </el-select>
                    </el-form-item>
                      </el-col>
                    <el-col :span="5" :offset="1">
                      <el-form-item :label="$t('assetsAudit.queryLabel.copyrightExpirationTime')" :label-width="queryformLabelWidth" >
                        <el-date-picker v-model.trim="formQueryCondition.copyrightEndDateStart.val" class="queryItemStyle" clearable
                                :placeholder="$t('assetsAudit.queryLabel.placeholderCopyrightExpirationTime')" format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" >
                        </el-date-picker>
                      </el-form-item>
                    </el-col>
                    <el-col :span="5" :offset="1">
                      <el-form-item :label="$t('queryLabel.timeTo')" :label-width="queryformLabelWidth" >
                          <el-date-picker v-model.trim="formQueryCondition.copyrightEndDateEnd.val" class="queryItemStyle" clearable
                                  :placeholder="$t('assetsAudit.queryLabel.placeholderCopyrightExpirationTime')" format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" >
                          </el-date-picker>
                      </el-form-item>
                    </el-col>
                  </el-row>
                    <!-- 版权到期时间 -->
                  <el-row>
                    <!-- 状态 -->
                    <el-col :span="5">
                      <el-form-item :label="$t('AssetsProviderManage.queryLabel.status')"  :label-width="queryformLabelWidth">
                        <el-select v-model="formQueryCondition.isEnable.val" class="queryItemStyle" >
                          <el-option :label="$t('label.all')" value=""></el-option>
                          <el-option :value="drug.valueCode" :key="drug.valueCode" :label="drug.valueText"
                              v-for="drug in enables"></el-option>
                          <!-- <el-option :label="$t('label.available')" value="Available"></el-option>
                          <el-option :label="$t('label.invalid')" value="Invalid"></el-option> -->
                        </el-select>
                      </el-form-item>
                    </el-col>
                  </el-row>
                    <!--创建时间-->
                    <!-- <el-form-item :label="$t('shellAssets.queryLabel.shellAssets.createTime')"  :label-width="queryformLabelWidth">
                        <el-date-picker v-model="formQueryCondition.createTimeStart.val" class="queryItemStyle"
                                        type="date" :placeholder="$t('shellAssets.label.pleaseSelectTime')">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item :label="$t('shellAssets.label.zhi')"  :label-width="queryformLabelWidth">
                        <el-date-picker v-model="formQueryCondition.createTimeEnd.val" class="queryItemStyle"
                                        type="date" :placeholder="$t('shellAssets.label.pleaseSelectTime')"></el-date-picker>
                    </el-form-item> -->

                    <!--修改时间-->
                    <!-- <el-form-item :label="$t('shellAssets.queryLabel.shellAssets.lastUpdateTime')"  :label-width="queryformLabelWidth">
                        <el-date-picker v-model="formQueryCondition.lastUpdateTimeStart.val" class="queryItemStyle"
                                        type="date" :placeholder="$t('shellAssets.label.pleaseSelectTime')"></el-date-picker>
                    </el-form-item>
                    <el-form-item :label="$t('shellAssets.label.zhi')"  :label-width="queryformLabelWidth">
                        <el-date-picker v-model="formQueryCondition.lastUpdateTimeEnd.val" class="queryItemStyle"
                                       type="date" :placeholder="$t('shellAssets.label.pleaseSelectTime')"></el-date-picker>
                    </el-form-item> -->

                    <!--授权到期时间-->
                    <!-- <el-form-item :label="$t('shellAssets.queryLabel.shellAssets.expireTime')"  :label-width="queryformLabelWidth">
                        <el-date-picker v-model="formQueryCondition.expireTime.val" class="queryItemStyle"
                                        type="date" :placeholder="$t('shellAssets.label.pleaseSelectTime')"></el-date-picker>
                    </el-form-item>
                    <el-form-item :label="$t('shellAssets.label.zhi')"  :label-width="queryformLabelWidth">
                        <el-date-picker v-model="formQueryCondition.expireEndTime.val" class="queryItemStyle"
                                         type="date" :placeholder="$t('shellAssets.label.pleaseSelectTime')"></el-date-picker>
                    </el-form-item> -->


                    <!--列表上面的按钮-->
                  <el-row>
                    <el-col :span="24">
                    <div style="text-align:right">
                        <!--批量注销-->
                        <el-form-item>
                          <el-button v-permission="{menuCode: menuCode,resourceCode: 'batchPassBtnText'}" type="primary" @click="batchDeletion(tableChecked,'batchPassBtnText')">{{$t('shellAssets.btnText.batchDeletion')}}</el-button>
                        <!--</el-form-item>-->
                        <!--新增-->
                        <!--<el-form-item>-->
                            <el-button v-permission="{menuCode: menuCode,resourceCode: 'saveBtnText'}" type="primary" @click="onNew('saveBtnText')">{{ $t('shellAssets.btnText.newBtnText') }}</el-button>
                        <!--</el-form-item>-->
                        <!--重置-->
                        <!--<el-form-item>-->
                            <el-button v-permission="{menuCode: menuCode,resourceCode: 'resetBtnText'}" type="primary" @click="onReset('form')">{{ $t('shellAssets.btnText.resetBtnText') }}</el-button>
                        <!--</el-form-item>-->
                        <!--导入-->
                        <!--<el-form-item>-->
                            <el-button v-permission="{menuCode: menuCode,resourceCode: 'ImportBtnText'}" type="primary" @click="openUploadDlg('ImportBtnText')" icon="el-icon-download" :loading="loading">{{ $t('shellAssets.btnText.ImportBtnText') }}</el-button>
                        <!--</el-form-item>-->
                        <!--导入模板下载 -->
                        <!--<el-form-item>-->
                            <el-button v-permission="{menuCode:menuCode,resourceCode:'downloadTemplate'}"  type="primary" @click="downloadTemplate('downloadTemplate')" icon="el-icon-download" :loading="loading">{{ $t('playManage.btnText.downloadTemplate') }}</el-button>
                        <!--</el-form-item>-->
                        <!--导出-->
                        <!--<el-form-item>-->
                            <el-button v-permission="{menuCode: menuCode,resourceCode: 'exportBtnText'}" type="primary" @click="onExport('exportBtnText')" icon="el-icon-upload2" :loading="loading">{{ $t('shellAssets.btnText.exportBtnText') }}</el-button>
                        <!--</el-form-item>-->
                        <!--查询-->
                        <!--<el-form-item>-->
                            <el-button v-permission="{menuCode: menuCode,resourceCode: 'queryBtnText'}" type="primary" @click="onQuery('queryBtnText')" icon="el-icon-search" :loading="loading">{{ $t('shellAssets.btnText.queryBtnText') }}</el-button>
                        </el-form-item>
                    </div>
                    </el-col>
                  </el-row>
                </el-form>
            </div>
            <!--列表-->
            <div class="dataBox" ref="dataBox">

                <el-table v-if="isInit" ref="singleTable"
                            :data="tableData"
                            :height="tableHeight"
                            @selection-change="handleSelectionChange"
                            @sort-change="sortChange"
                            v-loading="loading" size="mini"
                            style="width: 100%;" stripe=stripe border=border>
                    <!--多选框-->
                    <el-table-column type="selection" align="center" width="50" fixed="left">
                    </el-table-column>
                    <!--操作-->
                    <el-table-column :label="$t('table.op')" fixed="left" min-width="370">
                        <template slot-scope="scope">
                            <!--编辑-->
                            <el-button v-permission="{menuCode: menuCode,resourceCode: 'editBtnText'}"
                                size="gv" icon="el-icon-edit" :loading="loading" @click="edit(scope.$index, scope.row,'editBtnText')" >
                                {{ $t('shellAssets.btnText.editBtnText') }}
                            </el-button>
                            <!--资产详情-->
                            <el-button v-permission="{menuCode: menuCode,resourceCode: 'detailsBtnText'}"
                                size="gv" icon="el-icon-tickets" :loading="loading" @click="clickDetails(scope.$index, scope.row)" >
                                {{ $t('shellAssets.btnText.detailsBtnText') }}
                            </el-button>
                            <!--查看子资产详细-->
                            <el-button v-permission="{menuCode: menuCode,resourceCode: 'subassetBtnText'}"
                                size="gv" icon="el-icon-tickets" :loading="loading" @click="selectAssetsInfo(scope.$index, scope.row,'subassetBtnText')">
                                {{ $t('shellAssets.btnText.subAssetBtnText') }}
                            </el-button>
                            <!--查看演员信息-->
                            <el-button v-permission="{menuCode: menuCode,resourceCode: 'actorBtnText'}"
                                size="gv" icon="el-icon-tickets" :loading="loading" @click="selectActorInfo(scope.$index, scope.row,'actorBtnText')" >
                                {{ $t('shellAssets.btnText.actorBtnText') }}
                             </el-button>
                            <!--注销-->
                            <el-button v-permission="{menuCode: menuCode,resourceCode: 'passBtnText'}" v-show="scope.row.isEnable=='Available'"
                                size="gv" icon="el-icon-delete" type="danger" :loading="loading" @click="logoffRow(scope.$index, scope.row,'passBtnText')">
                                {{ $t('shellAssets.btnText.logoffBtnText') }}
                            </el-button>
                            <!--恢复注销 -->
                            <el-button v-show="scope.row.isEnable=='Invalid'"
                                    v-permission="{menuCode: menuCode, resourceCode: 'recoveryBtnText'}"
                                size="gv" icon="el-icon-delete" type="danger" :loading="loading" @click="revertLogoffRow(scope.$index, scope.row,'recoveryBtnText')">
                                {{ $t('shellAssets.btnText.revertLogoffBtnText') }}
                            </el-button>
                            <!--删除-->
                            <!-- <el-button v-permission="{menuCode: menuCode,resourceCode: 'passBtnText'}"
                                size="gv" icon="el-icon-delete" type="danger" :loading="loading" @click="delRow(scope.$index, scope.row)">
                                {{ $t('shellAssets.btnText.delBtnText') }}
                            </el-button> -->
                        </template>
                    </el-table-column>
                    <!--资产编号-->
                    <el-table-column prop="assetCode" min-width="140" fixed="left"
                                        :label="$t('assetsAudit.table.assetCode')" sortable="custom" sort-by="assetCode">
                    </el-table-column>
                    <!--资产名称-->
                    <el-table-column prop="assetName" min-width="160" fixed="left"
                                        :label="$t('assetsAudit.table.assetName')" sortable="custom" sort-by="assetName">
                    </el-table-column>
                    <!--资产类型-->
                    <el-table-column prop="assetType" min-width="110"
                                        :label="$t('shellAssets.table.shellAssets.type')" sortable="custom" sort-by="assetType">
                    </el-table-column>
                    <!--资产分类-->
                    <!-- <el-table-column prop="assetCapitalList" min-width="220"
                                        :label="$t('shellAssets.table.shellAssets.sort')"  sort-by="assetCapitalList">
                    </el-table-column> -->
                    <!--资产来源-->
                    <el-table-column prop="speAreaName" min-width="100"
                                        :label="$t('shellAssets.table.shellAssets.source')" sortable="custom" sort-by="speAreaName">
                    </el-table-column>
                    <!--资产提供方-->
                    <el-table-column prop="providerName" min-width="130"
                                        :label="$t('shellAssets.table.shellAssets.sourceInfo')" sortable="custom" sort-by="providerName">
                    </el-table-column>
                    <!--资产状态-->
                    <el-table-column prop="assetState" min-width="160"
                                        :label="$t('shellAssets.table.shellAssets.status')" sortable="custom" sort-by="assetState">
                    </el-table-column>
                    <!--下发状态-->
                    <el-table-column prop="sendtoStateName" min-width="160"
                                        :label="$t('shellAssets.table.shellAssets.sendtoState')" sortable="custom" sort-by="sendtoState">
                    </el-table-column>
                    <!--授权时间
                    <el-table-column prop="expireTime" min-width="120"
                                        :label="$t('shellAssets.table.shellAssets.expireTime')" sortable="custom" sort-by="expireTime">
                    </el-table-column>
                    -->
                    <!--版权结束时间-->
                    <!-- <el-table-column prop="expireEndTime" min-width="180"
                                        :label="$t('shellAssets.table.shellAssets.expireEndTime')" sortable="custom" sort-by="expireEndTime">
                    </el-table-column> -->
                    <!-- 版权到期时间 -->
                    <el-table-column prop="copyrightEndDate" min-width="180"
                                        :label="$t('shellAssets.table.shellAssets.copyrightExpirationTime')" sortable="custom" sort-by="copyrightEndDate">
                    </el-table-column>
                    <!--创建时间-->
                    <el-table-column prop="createdDate" min-width="180"
                                        :label="$t('shellAssets.table.shellAssets.createTime')" sortable="custom" sort-by="createdDate">
                    </el-table-column>
                    <!--最后修改时间-->
                    <el-table-column :label="$t('shellAssets.table.lastUpdateTime')" min-width="180" sortable="custom" prop="lastUpdatedDate" sort-by="lastUpdatedDate">
                    </el-table-column>
                    <!--最后修改人-->
                    <el-table-column :label="$t('shellAssets.table.lastUpdatedBy')" min-width="180" sortable="custom" prop="modifier" sort-by="modifier">
                    </el-table-column>

                </el-table>


            </div>
        </div>
        <!--分页-->
        <div class="pageBox">
            <el-pagination @size-change="sizeChange"
                            @current-change="currentPageChange"
                            :current-page="pager.curPage"
                            :page-sizes="pager.sizes"
                            :page-size="pager.curSize"
                            :background="true"
                            layout="total, sizes, prev, pager, next, jumper" :total="pager.total">
            </el-pagination>
        </div>

        <!--编辑对话框-->
        <el-dialog :title="$t('label.dialogTitle')" :visible.sync="isShowEditForm" top="5vh" :modal-append-to-body='false' :close-on-click-modal="false">
            <el-form :model="editForm" ref="editForm" size="mini"
                     :label-position="editFormPosition" status-icon=status-icon :rules="editRules">

                <!--资产名称-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.name')" :label-width="editformLabelWidth" prop="assetName">
                    <el-input v-model.trim="editForm.assetName" maxlength="25" v-on:input="setLetterSimplify" v-on:blur="setLetterSimplify()"
                              :placeholder="$t('shellAssets.label.placeholder')+$t('shellAssets.editLabel.shellAssets.name')"></el-input>
                </el-form-item>
                <!--资产类型-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.type')" :label-width="editformLabelWidth" prop="assetType">
                    <el-select v-model="editForm.assetType">
                        <el-option :value="drug.valueCode" :key="drug.valueCode" :label="drug.valueText"
                                v-for="drug in typeData"></el-option>
                    </el-select>
                </el-form-item>
                <!--资产分类-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.sort')" :label-width="editformLabelWidth" prop="capitalNameAll">
                    <!-- <el-select v-model="editForm.assetSort">
                        <el-option :value="item.capitalName" :key="item.capitalCode" :label="item.capitalName"
                                v-for="item in sortData"></el-option>
                    </el-select> -->
                    <el-input ref="tagInput" v-model.trim="editForm.capitalNameAll" maxlength="36" :placeholder="$t('shellAssets.label.chooseAssetClassification')" @focus="chooseCapital"></el-input>
                </el-form-item>
                <!--资产来源-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.source')" :label-width="editformLabelWidth" prop="assetSource">
                    <el-select v-model="editForm.assetSource">
                        <el-option :value="drug.keyId" :key="drug.keyId" :label="drug.speAreaName"
                                v-for="drug in source"></el-option>
                    </el-select>
                </el-form-item>
                <!--资产提供方信息-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.sourceInfo')" :label-width="editformLabelWidth" prop="assetProvider">
                   <el-select v-model="editForm.assetProvider">
                        <el-option :value="drug.keyId" :key="drug.keyId" :label="drug.providerName"
                                v-for="drug in AssetProvision"></el-option>
                    </el-select>
                </el-form-item>
                <!--版权开始时间-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.expireTime')" :label-width="editformLabelWidth" prop="copyrightStartDate">
                    <el-date-picker v-model="editForm.copyrightStartDate" type="date" :placeholder="$t('shellAssets.label.pleaseSelectTime')"></el-date-picker>
                </el-form-item>
                <!--版权结束时间-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.expireEndTime')" :label-width="editformLabelWidth" prop="copyrightEndDate">
                    <el-date-picker v-model="editForm.copyrightEndDate" type="date" :placeholder="$t('shellAssets.label.pleaseSelectTime')"></el-date-picker>
                </el-form-item>
                <!--上映时间-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.publishTime')" :label-width="editformLabelWidth" prop="publishTime">
                    <el-date-picker v-model="editForm.publishTime" type="date" :placeholder="$t('shellAssets.label.pleaseSelectTime')"></el-date-picker>
                </el-form-item>
                <!--首字母-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.initials')" :label-width="editformLabelWidth" prop="letterSimplify">
                    <el-input v-model.trim="editForm.letterSimplify" maxlength="25"
                              :placeholder="$t('shellAssets.label.placeholder')+$t('shellAssets.editLabel.shellAssets.initials')"></el-input>
                </el-form-item>
                <!--年份-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.years')" :label-width="editformLabelWidth" prop="assetYear">
                    <el-date-picker v-model="editForm.assetYear" type="year" :placeholder="$t('shellAssets.label.pleaseSelectTime')"></el-date-picker>
                </el-form-item>
                <!--版本-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.proType')" :label-width="editformLabelWidth" prop="proType">
                    <el-select v-model="editForm.proType">
                        <el-option :value="drug.valueCode" :key="drug.valueCode" :label="drug.valueText"
                                v-for="drug in proTypeData"></el-option>
                    </el-select>
                </el-form-item>
                <!--是否免费-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.isFee')" :label-width="editformLabelWidth" prop="isFee">
                    <el-select v-model="editForm.isFee">
                        <el-option :value="drug.valueCode" :key="drug.valueCode" :label="drug.valueText"
                                v-for="drug in isFeeData"></el-option>
                    </el-select>
                </el-form-item>
                <!--地区-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.area')" :label-width="editformLabelWidth" prop="assetArea">
                    <el-select v-model="editForm.assetArea">
                        <el-option :value="drug.valueCode" :key="drug.valueCode" :label="drug.valueText"
                                v-for="drug in area"></el-option>
                        <!-- <el-option :label="$t('shellAssets.label.area1')" value="area1"></el-option>
                        <el-option :label="$t('shellAssets.label.area2')" value="area2"></el-option>
                        <el-option :label="$t('shellAssets.label.area3')" value="area3"></el-option>
                        <el-option :label="$t('shellAssets.label.area4')" value="area4"></el-option>
                        <el-option :label="$t('shellAssets.label.area5')" value="area5"></el-option> -->
                    </el-select>
                </el-form-item>
                <!--语言-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.language')" :label-width="editformLabelWidth" prop="language">
                    <el-select v-model.trim="editForm.language" maxlength="50">
                        <el-option :value="drug.valueCode" :key="drug.valueCode" :label="drug.valueText"
                                            v-for="drug in Language"></el-option>
                    </el-select>
                </el-form-item>
                <!--年龄段-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.ageGroup')" :label-width="editformLabelWidth" prop="ageGroup">
                    <el-select v-model="editForm.ageGroup">
                        <el-option :value="drug.valueCode" :key="drug.valueCode" :label="drug.valueText"
                                v-for="drug in ageGroupData"></el-option>
                    </el-select>
                </el-form-item>
                <!--集数-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.episode')" :label-width="editformLabelWidth" prop="itemNum">
                    <el-input v-model.trim="editForm.itemNum" maxlength="20"
                              :placeholder="$t('shellAssets.label.placeholder')+$t('shellAssets.editLabel.shellAssets.episode')"></el-input>
                </el-form-item>
                <!--导演-->
                <el-form-item  :label="$t('shellAssets.editLabel.shellAssets.director')" :label-width="editformLabelWidth" prop="director">
                    <!-- <el-input v-model.trim="editForm.director" v-show="false" maxlength="200"></el-input> -->
                    <el-input v-model.trim="editForm.director" maxlength="200" @focus="chooseDirectorInfo" ref="director"
                              :placeholder="$t('shellAssets.label.placeholder')+$t('shellAssets.editLabel.shellAssets.director')"></el-input>
                    <!-- <el-button size="gv" icon="el-icon-tickets" :loading="loading" @click="chooseDirectorInfo" >选择导演</el-button> -->
                </el-form-item>
                <!--编剧-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.edit')" :label-width="editformLabelWidth" prop="edit">
                    <!-- <el-input v-model.trim="editForm.edit" v-show="false" maxlength="200"></el-input> -->
                    <el-input v-model.trim="editForm.edit" maxlength="200" @focus="chooseScreenwriterInfo"  ref="edit"
                              :placeholder="$t('shellAssets.label.placeholder')+$t('shellAssets.editLabel.shellAssets.edit')"></el-input>
                    <!-- <el-button size="gv" icon="el-icon-tickets" :loading="loading" @click="chooseScreenwriterInfo" >选择编剧</el-button> -->
                </el-form-item>
                <!--演员-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.actor')" :label-width="editformLabelWidth" prop="actor">
                    <!-- <el-input v-model.trim="editForm.actor" v-show="false" maxlength="200"></el-input> -->
                    <el-input v-model.trim="editForm.actor" maxlength="20" @focus="chooseActorInfo"  ref="actor"
                              :placeholder="$t('shellAssets.label.placeholder')+$t('shellAssets.editLabel.shellAssets.actor')"></el-input>
                    <!-- <el-button size="gv" icon="el-icon-tickets" :loading="loading" @click="chooseActorInfo" >选择演员</el-button> -->
                </el-form-item>
                <!--内容类型-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.contentType')" :label-width="editformLabelWidth" prop="contentType">
                    <el-select v-model="editForm.contentType">
                        <el-option :value="drug.valueCode" :key="drug.valueCode" :label="drug.valueText"
                                v-for="drug in contentTypeData"></el-option>
                    </el-select>
                </el-form-item>
                <!--播出状态-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.playStatus')" :label-width="editformLabelWidth" prop="tvState">
                    <el-select v-model="editForm.tvState">
                       <el-option :value="drug.valueCode" :key="drug.valueCode" :label="drug.valueText"
                                v-for="drug in BroadcastStatus"></el-option>
                    </el-select>
                </el-form-item>
                <!-- 标签 -->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.Label')" :label-width="editformLabelWidth" prop="tag" >
                    <el-input ref="tagInput" v-model.trim="editForm.tagNameAll" maxlength="36" :placeholder="$t('shellAssets.editLabel.shellAssets.pleaseSelectTheLabel')" @focus="chooseTag"></el-input>
                </el-form-item>

                <!--评分-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.score')" :label-width="editformLabelWidth" prop="score">
                    <el-input v-model.trim="editForm.score" maxlength="20"
                              :placeholder="$t('shellAssets.label.placeholder')+$t('shellAssets.editLabel.shellAssets.score')"></el-input>
                </el-form-item>
                <!--简介-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.introduction')" :label-width="editformLabelWidth" prop="assetSummary">
                    <el-input v-model.trim="editForm.assetSummary" maxlength="300"  type="textarea"
                              :placeholder="$t('shellAssets.label.placeholder')+$t('shellAssets.editLabel.shellAssets.introduction')"></el-input>
                </el-form-item>
                <!--剧情-->
                <!-- <el-form-item :label="$t('shellAssets.editLabel.shellAssets.plot')" :label-width="editformLabelWidth" prop="plot">
                    <el-input v-model.trim="editForm.plot" maxlength="300"  type="textarea"
                              :placeholder="$t('shellAssets.label.placeholder')+$t('shellAssets.editLabel.shellAssets.plot')"></el-input>
                </el-form-item> -->
                <!--剧情-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.assetsPlot')" :label-width="editformLabelWidth" prop="plot">
                    <el-input v-model.trim="editForm.plot" maxlength="300"  type="textarea"
                              :placeholder="$t('shellAssets.label.placeholder')+$t('shellAssets.editLabel.shellAssets.assetsPlot')"></el-input>
                </el-form-item>
                <!--海报-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.poster')" :label-width="editformLabelWidth" prop="poster">
                    <!-- <el-upload size="tiny" ref="upload" :action="UpdateAndSave" :data="editForm" accept=".png,.jpg, .jpeg"
                        :multiple="false" :on-preview="handlePreview" :on-remove="handleRemove" :on-error = "error" :on-success = "success" :file-list="fileList" :auto-upload="false"
                        :limit="1" :on-exceed="handleExceed" :headers="headersObj">
                        <el-button :loading="loading" round slot="trigger" size="mini" type="primary">选取文件</el-button>
                        <div slot="tip" class="el-upload__tip">只能上传600*800的jpg/png文件</div>
                    </el-upload> -->
                    <el-input v-model.trim="editForm.poster"  width="120" v-show="false"></el-input>
                    <el-upload
                        class="avatar-uploader"
                        :action="action"
                        :data="{site:'public',type:'asset_poster'}"
                        :show-file-list="false"
                        :on-success="handleAvatarSuccess"
                        :before-upload="beforeAvatarUpload">
                        <img v-if="imageUrl" :src="imageUrl" class="avatar">
                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                    </el-upload>
                </el-form-item>
                <!--视频横图海报-->
                <el-form-item :label="$t('shellAssets.editLabel.shellAssets.albumHorpic')" :label-width="editformLabelWidth" prop="albumHorpic">
                    <el-input v-model.trim="editForm.albumHorpic"  width="120" v-show="false"></el-input>
                    <el-upload
                        class="avatar-uploader"
                        :action="action"
                        :show-file-list="false"
                        :on-success="handleAvatarSuccessHorpic"
                        :before-upload="beforeAvatarUpload">
                        <img v-if="horpicImageUrl" :src="horpicImageUrl" class="avatar">
                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                    </el-upload>
                </el-form-item>
            </el-form>
            <div slot="footer">
                <!--取消按钮-->
                <el-button size="mini" @click="isShowEditForm = false" :loading="loading">{{ $t('btnText.cancelBtnText') }}</el-button>
                <!--保存按钮-->
                <el-button size="mini" type="primary" @click="submitUpload('editForm',currentResCode)" :loading="loading">{{ $t('btnText.saveBtnText') }}</el-button>
            </div>
        </el-dialog>
        <!--详情对话框-->
        <!-- <el-dialog :title="$t('label.dialogDetails')" :visible.sync="isShowDetails" top="5vh" width="60%">
            <el-tabs v-model="activeName" type="border-card">
            <el-tab-pane :label="$t('assetsAudit.assetInfo')" name="first">
                <assets-info :datas="dataForm"></assets-info>
            </el-tab-pane>
            </el-tabs>
        </el-dialog> -->
        <el-dialog :title="$t('label.dialogDetails')" :visible.sync="isShowDetails" top="5vh" width="60%" @close="renewRecord" :close-on-click-modal="false">
            <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
                <el-tab-pane :label="$t('assetsAudit.assetInfo')" name="first">
                    <assets-info :datas="dataForm"></assets-info>
                </el-tab-pane>
                <el-tab-pane :label="$t('assetsAudit.auditRecord')" name="second">
                    <audit-record :datas="reviewQueryCondition" ref="auditRecord"></audit-record>
                </el-tab-pane>
            </el-tabs>
        </el-dialog>


        <!--演员/编剧/导演选择框-->
        <el-dialog :title="$t('label.dialogDetails')" :visible.sync="isShowChoose" top="5vh" width="60%" :close-on-click-modal="false">
            <el-tabs v-model="ChooseName" type="border-card">
                 <actor-info ref="actorTwo" v-on:ShellAssets="ShellAssets" :datas="Character"></actor-info>
            </el-tabs>
        </el-dialog>

        <!--标签选择框  @close='closeDialog'-->
        <el-dialog :title="$t('label.dialogDetails')" :visible.sync="isShowTagChoose"  top="5vh" width="60%" :close-on-click-modal="false">
            <el-tabs type="border-card">
                 <tag-choose ref="chooseTag" v-on:tagChoose="linkToTag" :datas="option"></tag-choose>
            </el-tabs>
        </el-dialog>

        <!--分类选择框-->
        <el-dialog :title="$t('shellAssets.editLabel.shellAssets.assetClassificationSelection')" :visible.sync="isShowCapitalChoose" top="5vh" width="60%" :close-on-click-modal="false">
            <el-tabs type="border-card">
                 <capital-choose ref="chooseCapital" v-on:capitalChoose="linkToCapital" :checkedKeys="checkedKeys"></capital-choose>
            </el-tabs>
        </el-dialog>

        <!-- 导入 -->
        <el-dialog :title="$t('shellAssets.editLabel.shellAssets.import')" width="400px" :visible.sync="dlgUploadVisible" :close-on-click-modal="false">

            <upload-file
                v-bind:uploadUrl="uploadCourseMaterialUrl"
                v-bind:acceptFileType="'.xlsx'"
                v-bind:uploadParams="uploadCourseMaterialParams"
                v-bind:fileList="fileList"
                v-bind:autoUpload="false"
                v-bind:fileLimit="1"
                v-bind:selectName="$t('shellAssets.editLabel.shellAssets.selectFile')"
                v-bind:uploadBtn="$t('shellAssets.editLabel.shellAssets.submission')"
                v-bind:fileTypeText="'xlsx'"
                v-bind:submitSuccess="submitUploadSuccess"
                v-bind:source="source"
                v-bind:menuCode="menuCode"
            ></upload-file>
        </el-dialog>
  </div>


</template>

<script>

import comBaseVue from '../../baseViewModel';
import assetsInfo from  './ShellAssetsInfo';
import actorTwo from './ActorTwo';
import tagChoose from './TagChoose';
import capitalChoose from './CapitalChoose';
import auditRecord from  '../audit/AuditRecord';
import {chineseToPinYin} from "../../../util/chinese2pinyin.js";


export default {
  mixins: [comBaseVue],
  name:'ShellAssets',
  props: {
     menuCode: String
  },
  data () {

    return {
        headersObj: {
                'Authorization': 'Bearer ' + this.getUserInfo().tokenCode,
                'X-AOHO-UserId': this.getUserInfo().keyID
            },
        isShowCapitalChoose:  false,
        isShowTagChoose:  false,
        isShowActor:  false,
        isShowDetails:false,
        isShowChoose:false,
        ChooseName:'one',
        activeName: 'first',
        Character: null,
        option: null,
        checkedKeys:[],
        transmitData: [], // 传递给演员组件的数组
        transmitDataDirector: [], // 传递给导演组件的数组
        transmitScreenwriter: [], // 传递给导演组件的数组
        transmitDataLabel: [], // 传递给标签组件的数组
        tableChecked:[],//被选中的记录数据-----对应“批量删除”传的参数值
        ids:[],//批量删除id
        sortData: [],
        typeData: [],
        enables: [],
        ApprovalStatus: [],
        source: [],
        AssetProvision:[],
        BroadcastStatus:[],
        tableDatas:[],
        area:[],
        LabelGroups:[],
        Language:[],
        restaurants: [],
        isFeeData: [],//是否免费
        proTypeData: [],//版本
        ageGroupData: [],//年龄段
        contentTypeData: [],//内容类型
        isInit:false,
        tableHeight:100,
        queryformLabelWidth:"85px",
        // queryformLabelWidthLong:"100px",
        appDivStyle:{
            height:this.$store.getters.appHeight,
        },
        modelName:"com.ispr.iptv.entity.media.AssetEntity",//操作的实体类F
        modelName2:"com.ispr.iptv.entity.media.VAssetEntity",//操作的实体类F

        fileList2: [],
        //
        changeLogData:[],
        // 查询条件
        formQueryCondition: {
            // keyId: {
            //     key: 'keyId',
            //     op: '=', // 操作符
            //     val: '' // 查询的值
            // },
            assetCode: {
                key: 'assetCode',
                op: 'LIKE', // 操作符
                val: '' // 查询的值
            },
            assetName: {
                key: 'assetName',
                op: 'LIKE',
                val: ''
            },
            assetType: {
                key: 'assetType',
                op: '=',
                val: ''
            },
            // sort: {
            //     key: 'assetSort',
            //     op: '=',
            //     val: ''
            // },
            assetProvider: {
                key: 'assetProvider',
                op: 'LIKE',
                val: ''
            },
            assetSource: {
                group: 'assetSource1',
                key: 'assetSource',
                op: 'LIKE',
                val: ''
            },
            // tag: {
            //     key: 'assetAndTagList.tagId',
            //     op: '=',
            //     val: ''
            // },
            assetState: {
                key: 'assetState',
                op: '=',
                val: ''
            },
            copyrightEndDateStart: {
                key: 'copyrightEndDate',
                group:'copyrightEndDateStart',
                op: '>=',
                val: ''
            },
            copyrightEndDateEnd: {
                 key: 'copyrightEndDate',
                 group:'copyrightEndDateEnd',
                op: '<=',
                val: ''
            },
            isEnable: {
                key: "isEnable",
                op: "=", // 操作符
                val: "Available"
                },
        },
        oldObject: Object,
        // 编辑面板绑定的对象
        editForm: {
            keyId: 0,//资产ID
            version: 0,//版本号
            assetName: "",//资产名称
            assetCnname: "",//中文名称
            assetType: "",//"资产类型",
            // assetSort: "",//"资产分类",
            assetSource: "",//"资产来源"
            assetProvider: "",//"资产提供方信息",
            copyrightStartDate: "",//"版权开始时间",
            copyrightEndDate: "",//"版权结束时间"
            letterSimplify: "",//"首字母"
            assetYear: "",//"年份",
            assetArea: "",//"地区",
            language: "",//"语言",
            itemNum: "",//"集数",
            director: "",//"导演",
            edit: "",//"编辑",
            actor: "",//"演员",
            tvState: "",//"播出状态",
            tagNameAll: "",//显示多个标签,
            capitalNameAll: "",//显示多个分类,
            score: "",//"评分"
            assetSummary: "",//"简介"
            poster: "",//"海报"
            plot: "",//看点
            publishTime:"",//上映时间
            proType:"",//版本
            ageGroup:"",//年龄段
            isFee:"",//是否免费
            albumHorpic:"",//视频横图海报
            contentType:"",//内容类型
            actorList:[],
            editList:[],
            directorList:[],
            tagList:[],
            capitalList:[],
        },
        imageUrl: "",//"海报地址"
        horpicImageUrl: "",//"视频横图海报地址"
        editName:"",
        directorName:"",
        actorIsName:"",
        UpdateAndSave:"",//请求地址
        fileList: [], //文件集合
        // 编辑面板的验证规则
        editRules: {
            assetName: [{ required: true, message: this.$i18n.t('shellAssets.label.placeholder')+this.$i18n.t('shellAssets.editLabel.shellAssets.name'), trigger: 'blur' }],
            assetType: [{ required: true, message: this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderSort'), trigger: 'change' }],
            assetSource: [{ required: true, message: this.$i18n.t('shellAssets.editLabel.shellAssets.palceholderSource'), trigger: 'change' }],
            assetProvider: [{ required: true, message: this.$i18n.t('shellAssets.editLabel.shellAssets.palceholderProvider'), trigger: 'change' }],
            copyrightStartDate: [{required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderExpireTime'),trigger:'blur'}],
            copyrightEndDate:[{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderExpireEndTime'),trigger:'blur'}],
            letterSimplify:[{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderLetterSimplify'),trigger:'blur'}],
            tvState: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderPlayStatus'),trigger:'change'}],
            itemNum: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderEpisode'),trigger:'blur'}],
            capitalNameAll: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderSort'),trigger:'change'}],
            publishTime: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderPublishTime'),trigger:'change'}],
            assetYear: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderYears'),trigger:'change'}],
            proType: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderProType'),trigger:'change'}],
            isFee: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderIsFee'),trigger:'change'}],
            assetArea: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderArea'),trigger:'change'}],
            language: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderLanguage'),trigger:'change'}],
            ageGroup: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderAgeGroup'),trigger:'change'}],
            contentType: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderContentType'),trigger:'change'}],
            assetSummary: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderSummary'),trigger:'blur'}],
            plot: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderPlot'),trigger:'blur'}],
            director: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.editLabel.shellAssets.placeholderDirector'),trigger:'change'}],
            // edit: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderEdit'),trigger:'blur'}],
            actor: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.editLabel.shellAssets.placeholderActor'),trigger:'change'}],
            poster: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderPoster'),trigger:'change'}],
            albumHorpic: [{ required:true,message:this.$i18n.t('shellAssets.editLabel.shellAssets.placeholderAlbumHorpic'),trigger:'change'}],
        },
        dataForm: {
            keyId: 0,
            version: 0,
            assetCode: "",
            assetName: "",
            assetSource: "",
            assetType: "",
            assetProvider:"",
            status:"",
            createTime:"",
            updateTime:"",
            tag:"",
            sort:"",
            copyRightTimeS:"",
            copyRightTimeE:"",
            copyRightSource:"",
            copyRightRemark:"",
            cnName:"",
            firstChar:"",
            year:"",
            area:"",
            language:"",
            count:"",
            contentSort:"",
            director:"",
            adaptor:"",
            actor:"",
            tagNameAll: "",//显示多个标签,
            capitalNameAll: "",//显示多个分类,
        },
        // directorList: [],
        // editList: [],
        // actorList: [],//演员id
        // tagList:[],//多选标签
        // capitalList: [],//提交到后台的多个分类,
        //////////////////////////////////文件导入/////////////////////
        uploadCourseMaterialUrl: '/api/assets/upload',
        uploadCourseMaterialParams: null,
        dlgUploadVisible: false,
    // 排序对象
        sort: {
            key: "createdDate",
            dir: "Desc"
        },
        reviewQueryCondition: {
            code: {
                key: 'reviewDataId',
                op: '=', // 操作符
                val: ''
            },
            type: {
                key: 'reviewDataType',
                op: '=', // 操作符
                val: ''
            },
            assetName: {
                key: 'assetName',
                op: '=',
                val: ''
            },

        },
        //下发
        sendForm: {
            siteList: [],//下发到的站点
            sendType:"",
        },

    }
  },
  methods:{
     //查询按钮
     onQuery: function(rescode){
        this.currentResCode = (rescode && rescode!=='') ? rescode : '';
        if(this.formQueryCondition.copyrightEndDateStart.val!=null
        && this.formQueryCondition.copyrightEndDateStart.val!=""){
            this.formQueryCondition.copyrightEndDateStart.val=this.formatDate(this.formQueryCondition.copyrightEndDateStart.val);
        }
        if(this.formQueryCondition.copyrightEndDateEnd.val!=null
        && this.formQueryCondition.copyrightEndDateEnd.val!=""){
            this.formQueryCondition.copyrightEndDateEnd.val=this.formatDate(this.formQueryCondition.copyrightEndDateEnd.val);
        }
        this.pager.curPage = 1;
        this.queryTable();
    },
    // // 查询网格数据
    queryTable: function() {
        this.loading = true;
        var queryRequest = {
            className: this.modelName2,
            opKey: "Query",
            params: this.queryObjToArray(this.formQueryCondition),
            pageSize: this.pager.curSize,
            pageNum: this.pager.curPage,
            sort:[{col:this.sort.key,order:this.sort.dir}],
            userInfo: this.getUserInfo()
        };
        var _this = this;
        if (this.isExistResourceCode(this)) {
                this.headersObj['X-AOHO-Resource'] = this.menuCode + ',' + this.currentResCode;
              };
        this.axios.post('/api/assets/querypage', queryRequest, {headers: this.headersObj})
            .then(function(res) {
                if (res.data.code == "SUCCESS") {
                    _this.setTableData.call(_this, true, res.data.data);
                } else {
                    _this.setTableData.call(_this, false, res.data);
                }
            })
            .catch(function(error) {
                console.log(error);
                _this.setTableData.call(_this, false, "serverError");
            });
    },

/**
         * 将查询对象转换为数组
         * @param formQueryCondition
         * @returns {Array}
         */
        queryObjToArray: function (formQueryCondition) {
            if (!formQueryCondition) {
            return formQueryCondition;
            }
            let resultArr = [];
            Object.keys(formQueryCondition).forEach(function (item) {
            // formQueryCondition[item].key = item;
            // formQueryCondition[item].group = item;
            resultArr.push(formQueryCondition[item]);
            });
            return resultArr;
        },

    // 新增
    onNew: function(rescode){
        this.currentResCode = (rescode && rescode!=='') ? rescode : '';
        this.isShowEditForm = true;
        this.UpdateAndSave = '/api/assets/assetsSave';

        if (this.isExistResourceCode(this)) {
                this.headersObj['X-AOHO-Resource'] = this.menuCode + ',' + this.currentResCode;
            }
        if (this.$refs['editForm']) {
            this.$refs['editForm'].resetFields();
        }
        this.editForm.keyId = "";
        this.editForm.version = "";
        this.editForm.assetName = "";//"资产名称",
        this.editForm.assetCnname = "";//"中文名称",
        this.editForm.assetType = "";//"资产类型",
        this.editForm.assetSource = "";//"资产来源",
        this.editForm.assetProvider = "";//"资产提供方信息",
        this.editForm.copyrightStartDate = "";//"版权开始时间",
        this.editForm.copyrightEndDate = "";//"版权结束时间",
        this.editForm.letterSimplify = "";//"首字母",
        this.editForm.assetYear = "";//"年份",
        this.editForm.assetArea = "";//"地区",
        this.editForm.language = "";//"语言",
        this.editForm.itemNum = "";//"集数",
        this.editForm.director = "";//"导演",
        this.editForm.edit = "";//"编辑",
        this.editForm.actor = "";//"演员",
        this.editForm.capitalNameAll = "";//分类
        this.editForm.tagNameAll = "";//标签
        // this.editForm.tvState = "Released";//"播出状态",
        this.editForm.tvState = "";//"播出状态",
        this.editForm.score = "";//"评分",
        this.editForm.assetSummary = "";//"简介",
        / this.editForm.plot = "";//"剧情",
        this.editForm.poster = "";//"海报",
        this.editForm.isFee = "",//是否免费
        this.editForm.ageGroup = "",//年龄段
        this.editForm.albumHorpic = "",//视频横图海报
        this.editForm.proType = "",//版本
        this.editForm.publishTime = "",//上映时间
        this.editForm.contentType = "",//内容类型
        this.editName = "";
        this.directorName = "";
        this.actorIsName = "";
        this.editForm.isEnable = "Available";
        this.editForm.sendtoState = "StayDown";
        this.editForm.assetState = "PendingReview";
        //this.curCommand = "SaveNew";
        this.canEditCode = false;
        this.fileList = [];
        this.imageUrl = "";
        this.horpicImageUrl = "";
        this.editForm.directorList = [];
        this.editForm.editList = [];
        this.editForm.actorList = [];
        this.editForm.tagList = [];
        this.editForm.capitalList = [];
        this.transmitScreenwriter = [];
        this.transmitDataDirector = [];
        this.transmitData = [];
        this.transmitDataLabel = [];
    },

     // 重置
    onReset:function(){
        if (this.$refs['form']) {
            this.$refs['form'].resetFields();
        }

        // this.formQueryCondition.keyId.val = "";
        this.formQueryCondition.assetCode.val = "";
        this.formQueryCondition.assetName.val = "";
        this.formQueryCondition.assetType.val = "";
        // this.formQueryCondition.sort.val = "";
        this.formQueryCondition.assetProvider.val = "";
        this.formQueryCondition.assetSource.val = "";
        // this.formQueryCondition.tag.val = "";
        this.formQueryCondition.assetState.val = "";
        this.formQueryCondition.copyrightEndDateEnd.val = "";
        this.formQueryCondition.copyrightEndDateStart.val = "";
        this.formQueryCondition.isEnable.val = "Available";
    },
     // 提交编辑面板数据
        // submitForm: function submitForm(formName) {
        //     var _this = this;
        //     //this.setEditFormCheck();
        //     var time = new Date(this.editForm.assetYear);
        //         this.editForm.assetYear = time.getFullYear();
        //         this.editForm.directorList = this.directorList;
        //         this.editForm.editList = this.editList;
        //         this.editForm.actorList = this.actorList;
        //     this.$refs[formName].validate(function (valid) {
        //         if (valid) {
        //             _this.loading = true;
        //             _this.procCommandSave(
        //                 _this.curCommand,
        //                 _this.modelName,
        //                 "Default",
        //                 _this.editForm,
        //                 _this.submitFormCallbackSave);
        //         } else {
        //             return false;
        //         }
        //     });
        // },
        // procCommandSave: function(commandCode, className, commandArgs, commandBody,callback) {
        //     var requestArgs = {
        //         commandCode: commandCode,
        //         className: className,
        //         commandArgs: commandArgs,
        //         commandBody: commandBody,
        //         userInfo: this.getUserInfo()
        //     };
        //     this.axios.post(this.UpdateAndSave,
        //             requestArgs, {
        //                 headers: {
        //                     'Authorization': requestArgs.userInfo.tokenCode
        //                 }
        //             })
        //         .then(function(res) {
        //             if (res.data.code == "SUCCESS") {
        //                 callback.call(this, true, res.data.data);
        //             } else {
        //                 callback.call(this, false, res.data);
        //             }
        //         })
        //         .catch(function(error) {
        //             console.log(error);
        //             callback.call(this, false, "serverError");
        //         });
        // },
        // 执行命令后的回调函数
        submitFormCallbackSave: function submitFormCallbackSave(isSuccess,json) {
            this.loading = false;
            if(isSuccess){
                this.isShowEditForm = false;
                this.$message({
                    message: this.$i18n.t("message.successTip"),//resource.message.successTip,
                    type: 'success'
                });
                this.queryTable();
            }
            else
            {
                this.$message({
                                message: this.$i18n.t("errorCode." + json.msg),
                                type: 'warning'
                                });
            }
        },
    //批量注销
    batchDeletion: function(rows,rescode){
        this.currentResCode = (rescode && rescode!=='') ? rescode : '';
        if(this.tableChecked.length==0){
            this.$message.warning("请选择要注销的资产");
            return;
        };
        var _this = this;
        _this.ids = [];
            this.$confirm(this.$i18n.t("message.confirmlogoffMessage"),
                this.$i18n.t("message.confirmTitle"), {
                confirmButtonText: this.$i18n.t("message.yes"),
                cancelButtonText: this.$i18n.t("message.cancel"),
                type: "warning",
                callback: function (action, instance) {
                    if (action == "confirm") {
                        rows.forEach(element =>{
                            //alert(element.keyId);
                            _this.ids.push(
                                {"keyId":element.keyId, "version": element.version, isEnable: "Invalid"})
                    })
                    var commandBody = _this.ids;
                        //var commandBody = {  "keyId": row.keyId, "version": row.version, isEnable: "Invalid" };
                        // var commandBody = {
                        //     data: [{ keyID: row.keyID, ver: row.version }],
                        //     val: "Invalid",
                        //     count: 1
                        // };
                        _this.loading = true;
                        _this.procCommand("AssetManagementBatchDelete",//"ChangeIsEnabledState",
                                _this.modelName,
                                "N",
                                commandBody,
                                null,
                                _this.submitFormCallback);
                    }

                }
            });
    },

    // 授权按钮单击事件
    editMenu: function(index, row) {

    },
    //格式化显示
    formatFunc: function (str) {
          return str > 9 ? str : '0' + str
    },
    // 格式化上映时间yyyymmdd
    getyyyyMMdd: function(val){
      const temp = new Date(val);
      const temp1 = temp.getFullYear();
      const temp2 = this.formatFunc(temp.getMonth()+1);
      const temp3 = this.formatFunc(temp.getDate());
      const resultTemp = temp1+''+temp2+''+temp3;
      // let date1 = temp.setMinutes(temp.getMinutes() - temp.getTimezoneOffset()); // toJSON 的时区补偿
      // let resultTemp =  temp.toJSON().substr(0, 11).replace(/[-T]/g, ''); //yyyymmdd
      return resultTemp
    },
    /////////////////////////////文件上传//////////////////////////////////////////////
    //表单提交
    submitUpload: function submitUpload (rescode){
        var _this = this;
        this.currentResCode = (rescode && rescode!=='') ? rescode : '';
        // alert("上传");
        var B = false;
        this.$refs["editForm"].validate(function (valid) { if (!valid){B = true;} });//数据表单验证
        if(B){return false;}
        var time = new Date(this.editForm.assetYear);
        this.editForm.assetYear = time.getFullYear();
        this.editForm.copyrightStartDate = this.formatDate(this.editForm.copyrightStartDate);
        this.editForm.copyrightEndDate = this.formatDate(this.editForm.copyrightEndDate);
        if(this.editForm.publishTime){
          this.editForm.publishTime = this.getyyyyMMdd(this.editForm.publishTime);
        }
        // alert("上传");
        //文件表单验证
        // if (!this.$refs.upload.uploadFiles.length || this.$refs.upload.uploadFiles.length <= 0) {
        //     this.$message.warning('您未选择上传文件');
        //     return false;
        // }
        // window.setTimeout(this.$refs.upload.submit(),100);
         let requestArgs = {
                commandCode: null,
                className: this.modelName,
                commandArgs: null,
                commandOldBody: this.oldObject,
                commandBody: this.editForm,
                params: null,
                userInfo: this.getUserInfo()
        };
        // let headersObj = {
        //     'Authorization': 'Bearer ' + this.getUserInfo().tokenCode,
        //     'X-AOHO-UserId': this.getUserInfo().keyID
        // };
        // if (this.isExistResourceCode(this)) {
        //     headersObj['X-AOHO-Resource'] = this.menuCode + ',' + this.currentResCode;
        // }
        // this.axios.post(this.UpdateAndSave,
        //         requestArgs, { headers: headersObj })
        // this.axios.post(this.UpdateAndSave,requestArgs,this.commonCallback);
        this.axios.post(this.UpdateAndSave,
                requestArgs, {headers: this.headersObj})
            .then(function(res) {

                if (res.data.code == "SUCCESS") {
                   _this.isShowEditForm = false;
                    // callback.call(Vue, true, res.data.data);
                    _this.$message.success(_this.$i18n.t("message.successTip"));
                    _this.queryTable();
                } else {
                    // callback.call(Vue, false, res.data);
                    _this.$message.warning(res.data.msg);
                }
            })
            .catch(function(error) {
                _this.isShowEditForm = false;
                _this.$message.error("Server error");
                console.log(error);
            });

    },

    //回调函数
    commonCallback: function (isSuccess,json) {
        this.loading = false;
        if(isSuccess){
        this.isShowEditForm = false;
            this.$message({
                message: this.$i18n.t("message.successTip"),//resource.message.successTip,
                type: 'success'
            });
            this.queryTable();
        }
        else
        {
            this.$message({
                            message: this.$i18n.t("errorCode." + json.reason),
                            type: 'warning'
                            });
        }
    },

    // 移除文件
    handleRemove: function handleRemove (file, fileList) {
      //this.$message.success('移除成功！');
    },
    // 点击文件列表中已上传的文件时的钩子
    handlePreview: function handlePreview (file) {

    },
    // 文件超出个数限制时的钩子
    handleExceed: function handleExceed (files, fileList) {
      this.$message('上传文件数量超过限制');
    },
    //文件上传失败时的钩子
    error: function error () {
      this.$message.error('上传失败！');
    },
    //文件上传成功时的钩子
    success: function success (response, file, fileList) {
      if (response.code === 'SUCCESS') {
        this.$message.success('操作成功！');
        this.isShowEditForm = false;
        this.onQuery();
      } else {
        this.$message.error(response.msg);
      }
    },
    /////////////////////////////////////////上传结束///////////////////////////////////////////////////////
    // 导出
    onExport: function(rescode){
        this.currentResCode = (rescode && rescode!=='') ? rescode : '';
        let param = {
          'className': 'com.ispr.iptv.entity.media.AssetEntity',
          'opKey': 'Export',
          'params':this.queryObjToArray(this.formQueryCondition),

          'sort': [{ 'col': 'keyId', 'order': 'desc' }],
          'fileName': '资产管理'
        };
        let fileName = '资产管理' + '.xlsx';
        this.downloadByIdOrName(this, '/file/export', 'param', JSON.stringify(param), fileName);
      },

     /////下载导入模板
    downloadTemplate: function downloadTemplate () {
      this.downloadByIdOrName(this, '/import/downtemplate', 'fileName', '资产管理导入模板.xlsx', '资产管理导入模板.xlsx');
    },
/////////////////////////////////// 资产导入 ///////////////////////////////////////////
    // 打开导入资产的dialog
    openUploadDlg: function openUploadDlg () {
        // 初始化错误文件下载id
        this.errorTaskId = null;
        // 清空文件列表
        this.fileList = [];
        this.dlgUploadVisible = true;
        this.uploadCourseMaterialParams = {'className': this.modelName};
    },

    submitUploadSuccess: function submitUploadSuccess (response, file, fileList) {
      if (response.code === 'SUCCESS') {
        if (response.data.status === '0') {
          this.dlgUploadVisible = false;
          this.$message.success('导入任务创建成功');
          this.fileList = []; // 清空上传文件列表
          // 刷新表格数据
          //this.onQuery();
          return false;
        }
        if (response.data.status === '3') {
          let _this = this;
          this.$alert('导入失败，是否下载失败原因文件?', '提示', {
            confirmButtonText: '确定',
            callback: function callback (action) {
              if (action === 'confirm') {
                _this.downloadByIdOrName(_this, '/import/downerr', 'taskId', response.data.taskId, response.data.errFileName);
              } else {
                _this.$message({
                  type: 'info',
                  message: '已取消'
                });
              }
            }
          });
          this.fileList = []; // 清空上传文件列表
          this.dlgUploadVisible = false;
        }
      } else {
        this.$message.error(response.msg);
      }
    },
//////////////////////////////////////////////////////////////////////////////////////////////////
    // 编辑按钮单击事件
    edit: function(index, row,rescode){
        this.currentResCode = (rescode && rescode!=='') ? rescode : '';
        //dataAccess.queryDomainModelByKeyID(this, modelName, "Query", row.keyID, true, this.$options.methods.editCallback);
        this.queryModelByKeyID(this.modelName,row.keyId,"ById",this.editCallback);
    },
    //根据数据表ID查询数据
        // queryModelByKeyID : function(className, keyID, queryArgs, callback) {
        //     var queryRequestArgs = {
        //         className: className,
        //         keyID: keyID,
        //         opKey: queryArgs,
        //         userInfo: this.$cookies.get(configObject.cookiesSetting.name)
        //     };
        //     this.axios.post('/api/assets/selectAsset', queryRequestArgs)
        //         .then(function(res) {
        //             if (res.data.code == "SUCCESS") {
        //                 callback.call(this, true, res.data.data);
        //             } else {
        //                 callback.call(this, false, res.data);
        //             }
        //         })
        //         .catch(function(error) {
        //             console.log(error);
        //             callBack.call(this, false, "serverError");
        //         });
        // },
        // 编辑回显上映时间的转换yyyy-mm-dd
        getFormatedDate:function(date) {
            let item = new Date(date);
            var pattern = /(\d{4})(\d{2})(\d{2})/;
            var formatedDate = date.replace(pattern, '$1-$2-$3');
            return formatedDate;
        },
    // 编辑按钮回调事件
    editCallback: function(isSuccess,json) {

        // console.log("json=>",json)
        // this.directorList= [];
        // this.editList= [];
        // this.actorList= [];
        // console.info("json===>"+JSON.stringify(json));
        if(isSuccess){
            //this.curCommand = "PartialUpdateProc";
            this.UpdateAndSave = '/api/assets/UpdateAsset';
            if (this.isExistResourceCode(this)) {
                this.headersObj['X-AOHO-Resource'] = this.menuCode + ',' + this.currentResCode;
            }

            this.isShowEditForm = true;
            if (this.$refs['editForm']) {
                this.$refs['editForm'].resetFields();
            }
            this.editForm.keyId = json.keyId;
            this.editForm.version = json.version;
            this.editForm.assetCode = json.assetCode;
            this.editForm.assetName = json.assetName;//"资产名称",
            this.editForm.assetCnname = this.editForm.assetName;//"中文名称",
            this.editForm.assetType = json.assetType;//"资产类型",
            // this.editForm.assetSort = json.assetSort;//资产分类
            this.editForm.assetSource = json.assetSource;//"资产来源",
            this.editForm.assetProvider = json.assetProvider;//"资产提供方信息",
            this.editForm.copyrightStartDate = json.copyrightStartDate;//"版权开始时间",
            this.editForm.copyrightEndDate = json.copyrightEndDate;//"版权结束时间",
            this.editForm.letterSimplify = json.letterSimplify;//"首字母",
            this.editForm.assetYear = json.assetYear;//"年份",
            this.editForm.assetArea = json.assetArea;//"地区",
            this.editForm.language = json.language;//"语言",
            if(json.itemNum!=null && json.itemNum!="null"){
                this.editForm.itemNum = json.itemNum;//"集数",
            }else{
                this.editForm.itemNum = "";//"集数",
            }
            this.editForm.tvState = json.tvState;//"播出状态",
            this.editForm.score = json.score;//"评分",
            this.editForm.assetSummary = json.assetSummary;//"简介",
            this.editForm.poster = json.poster;//"海报",
            if(json.publishTime){
              this.editForm.publishTime = this.getFormatedDate(json.publishTime); //上映时间
            }
            this.editForm.proType = json.proType;//版本
            this.editForm.ageGroup = json.ageGroup;//年龄段
            this.editForm.isFee = json.isFee;//是否免费
            this.editForm.albumHorpic = json.albumHorpic;//视频横图海报
            this.editForm.contentType = json.contentType;//内容类型
            this.editForm.plot = json.plot;//看点
            this.editForm.assetState = "PendingReview";
            this.imageUrl = json.poster;
            this.horpicImageUrl = json.albumHorpic;

            this.fileList = [{name:json.poster,uid:1,percentage:0,raw:{uid:1},status:"ready"}];
            // var directorA = "";
            // for(var i = 0; i<json.assetAndActorList.size;i++){
            //     var s = "";
            //     if(json.assetAndActorList[i].profession == "director"){
            //         this.directorList.push(json.assetAndActorList[i].keyId);
            //         alert(this.directorList[i])
            //         if(this.directorA == ""){
            //             s = json.assetAndActorList[i].actorName;
            //             this.directorA = s;
            //         }else{
            //             s = json.assetAndActorList[i].actorName;
            //             this.directorA =directorA+","+s;
            //         }
            //     }
            // };
            var actor = "";
            var edit ="";
            var director = "";
            var directorId = []; // 导演
            var editId = []; // 编剧
            var actorId = []; // 演员
            let tempDirectorId = [];
            let tempEditId = [];
            let tempActorId = [];
            json.assetAndActorList.forEach(element =>{
                    var A = "";
                    var B = "";

                    if(element.profession == "导演"){
                        //element.profession == "director"
                        A = element.actorName;
                        B = element.keyId;
                        tempDirectorId.push({'keyId':B,'actorName':A});
                        if(director == ""){
                            director = A;
                            directorId.push(B);
                        }else{
                            director = director+","+ A;
                            directorId.push(B);
                        }
                    }else if(element.profession == "编剧"){
                        //element.profession == "screenwriter"
                        A = element.actorName;
                        B = element.keyId;
                        tempEditId.push({'keyId':B,'actorName':A});
                        if(edit == ""){
                            edit = A;
                            editId.push(B);
                        }else{
                            edit = edit+","+ A;
                            editId.push(B);
                        }
                    }else if(element.profession == "演员"){
                        //element.profession == "actor"
                        A = element.actorName;
                        B = element.keyId;
                        tempActorId.push({'keyId':B,'actorName':A});
                        if(actor == ""){
                            actor = A;
                            actorId.push(B);
                        }else{
                            actor = actor+","+ A;
                            actorId.push(B);
                        }
                    }
                })

            this.transmitDataDirector = tempDirectorId;
            this.transmitScreenwriter = tempEditId;
            this.transmitData = tempActorId;

            this.editForm.directorList = directorId;
            this.editForm.editList = editId;
            this.editForm.actorList = actorId;
            this.editForm.director = director;//"导演",
            this.editForm.edit = edit;//"编剧",
            this.editForm.actor = actor;//"演员",
            // this.directorName = director;//"导演",
            // this.editName = edit;//"编剧",
            // this.actorIsName = actor;//"演员",
            this.canEditCode = true;
            //标签
            this.editForm.tagNameAll = "";
            let temp = "";
            let tempId = [];
            let tagTemp = [];
            json.assetAndTagList.forEach(element =>{
                tagTemp.push({'keyId':element.keyId,'tagName':element.tagName});
                if(temp==""){
                    temp = element.tagName;
                    tempId.push(element.keyId);
                }else{
                    temp = element.tagName + "," + temp;
                    tempId.push(element.keyId);
                }
            });
            this.transmitDataLabel = tagTemp;
            this.editForm.tagNameAll = temp;
            this.editForm.tagList = tempId;

            //资产分类
            this.editForm.capitalNameAll = "";
            temp = "";
            tempId = [];
            json.assetCapitalList.forEach(element => {
                if(temp==""){
                    temp = element.capitalName;
                    tempId.push(element.keyId);
                }else{
                    temp = element.capitalName + "," + temp;
                    tempId.push(element.keyId);
                }
            });
            this.editForm.capitalNameAll = temp;
            this.editForm.capitalList = tempId;
            this.oldObject = JSON.parse(JSON.stringify(this.editForm));
            this.oldObject.copyrightStartDate = json.copyrightStartDateString;//"版权开始时间",
            this.oldObject.copyrightEndDate = json.copyrightEndDateString;//"版权结束时间",
        }
        else{
            this.$message({
                message: this.$i18n.t("errorCode." + json.reason,json.message),
                type: 'warning'
                });
        }
    },

    handleRemove(file, fileList) {
        // console.log(file, fileList);
      },
    handlePreview(file) {
        // console.log(file);
    },
    // 选择演员单击事件
    chooseActorInfo: function(){
        // debugger
        // if(this.transmitData === null){
        //     this.transmitData.push('123')
        // }

            this.Character = {opt:"Actor",isClear:"true",transmitData:this.transmitData};
            this.isShowChoose = true;
            this.$refs.actorTwo.transmitData(this.transmitData);
            this.$refs.actorTwo.onReset();
            this.$refs.actorTwo.onQuery();


        // this.$refs.actorTwo.tableChecked = [];
    },
    //选择导演单机事件
    chooseDirectorInfo: function(){

        this.Character = {opt:"Director",isClear:"true",transmitData:this.transmitDataDirector};
        this.isShowChoose = true;
        this.$refs.actorTwo.transmitData(this.transmitDataDirector);
        this.$refs.actorTwo.onReset();
        this.$refs.actorTwo.onQuery();
        // this.$refs.actorTwo.tableChecked = [];
    },
    //选择编剧单击事件
    chooseScreenwriterInfo: function(){

        this.Character = {opt:"Screenwriter",isClear:"true",transmitData:this.transmitScreenwriter};
        this.isShowChoose = true;
        this.$refs.actorTwo.transmitData(this.transmitScreenwriter);
        this.$refs.actorTwo.onReset();
        this.$refs.actorTwo.onQuery();
        // this.$refs.actorTwo.tableChecked = [];
    },
    //恢复注销
    revertLogoffRow: function(index, row,rescode){
        this.currentResCode = (rescode && rescode!=='') ? rescode : '';
       var _this = this;
            this.$confirm(this.$i18n.t("message.confirmRevertLogoffMessage"),
                this.$i18n.t("message.confirmTitle"), {
                confirmButtonText: this.$i18n.t("message.yes"),
                cancelButtonText: this.$i18n.t("message.cancel"),
                type: "warning",
                callback: function (action, instance) {
                    if (action == "confirm") {
                        var commandBody = {  "keyId": row.keyId, "version": row.version, isEnable: "Available" };
                        // var commandBody = {
                        //     data: [{ keyID: row.keyID, ver: row.version }],
                        //     val: "Invalid",
                        //     count: 1
                        // };
                        _this.loading = true;
                        _this.procCommand("RecoveryProc",//"ChangeIsEnabledState",
                                _this.modelName,
                                "N",
                                commandBody,
                                null,
                                _this.submitFormCallback);
                    }

                }
            });
    },
    // 详情按钮单击事件
    clickDetails: function(index, row) {
       this.queryModelByKeyID(this.modelName,row.keyId,"Query",this.showDetails);
        this.reviewQueryCondition.code.val = row.keyId;//资产id
        this.reviewQueryCondition.type.val = "ASSET";
        this.reviewQueryCondition.assetName.val = row.assetName;
    },
    // 详情按钮回调事件
    showDetails: function(isSuccess,json) {
        if(isSuccess){
            //this.curCommand = "UpdateProc";
            this.isShowDetails = true;
            this.dataForm=json;
            if(json.assetYear!=null && json.assetYear!="" && json.assetYear!="NaN"){
                this.dataForm.assetYear=json.assetYear;
            }else{
                this.dataForm.assetYear="";
            }
            var actor = "";
            var edit ="";
            var director = "";
            json.assetAndActorList.forEach(element =>{
                    var A = "";
                    if(element.profession == "导演"){
                        //element.profession == "director"
                        A = element.actorName;
                        if(director == ""){
                            director = A;
                        }else{
                            director = director+","+ A;
                        }
                    }else if(element.profession == "编剧"){
                        //element.profession == "screenwriter"
                        A = element.actorName;
                        if(edit == ""){
                            edit = A;
                        }else{
                            edit = edit+","+ A;
                        }
                    }else if(element.profession == "演员"){
                        //element.profession == "actor"
                        A = element.actorName;
                        if(actor == ""){
                            actor = A;
                        }else{
                            actor = actor+","+ A;
                        }
                    }
                })
            this.dataForm.director = director;//"导演",
            this.dataForm.adaptor = edit;//"编剧",
            this.dataForm.actor = actor;//"演员",
            // if (this.$refs['dataForm']) {
            //     this.$refs['dataForm'].resetFields();
            // }

            // this.dataForm.keyID=json.keyID;
            // this.dataForm.version=json.version;
            // this.dataForm.code=json.code;
            // this.dataForm.name = json.name;//"资产名称",
            // this.dataForm.type = json.type;//"资产类型",
            // this.dataForm.source = json.source;//"资产来源",
            // this.dataForm.sourceInfo = json.sourceInfo;//"资产提供方信息",
            // this.dataForm.expireTime = json.expireTime;//"版权开始时间",
            // this.dataForm.expireEndTime = json.expireEndTime;//"版权结束时间",
            // this.dataForm.classification = json.classification;//"资产类型",keyID: 0,
            // this.dataForm.providerInfo = json.providerInfo;
            // this.dataForm.status = json.status;
            // this.dataForm.createTime = json.createTime;
            // this.dataForm.updateTime = json.updateTime;
            // this.dataForm.tag = json.tag;
            // this.dataForm.sort = json.sort;
            // this.dataForm.copyRightTimeS = json.copyRightTimeS;
            // this.dataForm.copyRightTimeE = json.copyRightTimeE;
            // this.dataForm.copyRightSource = json.copyRightSource;
            // this.dataForm.copyRightRemark = json.copyRightRemark;
            // this.dataForm.cnName = json.cnName;//"首字母",
            // this.dataForm.years = json.years;//"年份",
            // this.dataForm.area = json.area;//"地区",
            // this.dataForm.language = json.language;//"语言",
            // this.dataForm.firstChar = json.firstChar;//"集数",
            // this.dataForm.count = json.count;//"导演",
            // this.dataForm.contentSort = json.contentSort;//"编辑",
            // this.dataForm.adaptor = json.adaptor;//"演员",
            // this.dataForm.director = json.director;//"播出状态",
            this.dataForm.tagNameAll = "";
            let temp = "";
            json.assetAndTagList.forEach(element =>{
                if(temp==""){
                    temp = element.tagName;
                }else{
                    temp = element.tagName + "," + temp;
                }
            });
            this.dataForm.tagNameAll = temp;
        }else{
            this.$message({
                message: this.$i18n.t("errorCode." + json.reason,json.message),
                type: 'warning'
                });
        }
    },
    handleClick(tab, event) {
        if(tab.name=="second"){
            this.$refs.auditRecord.onQuery();
        }
    },
    renewRecord: function(){
        this.activeName = "first";
    },

    //竖图海报上传成功时触发
    handleAvatarSuccess(res, file) {
        //alert(res.data);
        //alert(URL.createObjectURL(file.raw));
        this.imageUrl = res.data;
        this.editForm.poster = res.data;
    },
    //横图海报上传成功时触发
    handleAvatarSuccessHorpic(res, file) {
        //alert(res.data);
        //alert(URL.createObjectURL(file.raw));
        this.horpicImageUrl = res.data;
        this.editForm.albumHorpic = res.data;
    },

    //上传前的校验
    beforeAvatarUpload(file) {
        const isJPG = file.type === 'image/jpeg';
        const isLt2M = file.size / 1024 / 1024 < 1;

        if (!isJPG) {
          this.$message.error('上传图片只能是 JPG 格式!');
        }
        if (!isLt2M) {
          this.$message.error('上传图片大小不能超过 1MB!');
        }
        return isJPG && isLt2M;
    },

    /**查看子资产信息 */
    selectAssetsInfo: function(index, row,rescode){
        this.currentResCode = (rescode && rescode!=='') ? rescode : '';
        this.$parent.setCurrentComponent("Assets",{curRootAssets:row.keyId,curRootAssetsCode:row.assetCode,curRootAssetsName: row.assetName,isNeedGoBack:true,menuCode: this.menuCode });
        // this.queryModel("com.ispr.iptv.entity.media.SubAssetEntity","Query",[{key:"assetId",op:"=", val: row.keyId},{key: "isEnable",op: "=",val: "Available"}],this.pager,this.sort,this.assetsInfoCallback)

    },




    /**查看演员信息 */
    selectActorInfo: function(index, row,rescode){
        this.currentResCode = (rescode && rescode!=='') ? rescode : '';
        // console.log(this.$parent);
        // console.log(this.$parent.setCurrentComponent);
        this.$parent.setCurrentComponent("Actor",{curRootAssets:row.keyId,isNeedGoBack:true,menuCode: this.menuCode });
            // this.$router.push({
            //     path: 'Actor',
            //     name: 'Actor',
            //     params: {
            //     code: row.code,
            //     name: row.name,
            // } });//跳转到该路由
    },
    // 为资产来源下拉框赋值
    findSort:function(){
        var queryRequest = {
                className: "com.ispr.iptv.entity.media.CapitalEntity",//修改为被查询的实体地址
                opKey: "Query",//后台编写相应的接口实现方法，主要负责转化类型
                params: [{key: 'isEnable',op: '=',val: 'Available'}],
                userInfo: this.getUserInfo()
            };
            var _this = this;
            this.axios.post('/api/query', queryRequest, {headers: this.headersObj})//findAllValueType修改为query
                .then(function(res) {
                    // alert(JSON.stringify(res));
                    // alert(res.data.code);
                    if (res.data.code == "SUCCESS") {
                        _this.sortData = [];
                        for (var i = 0; i < res.data.data.length; i++) {
                            _this.sortData.push(res.data.data[i]);
                        }
                    } else {
                        // this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
                    }
                })
                .catch(function(error) {
                    console.log(error);
                    // this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
                });
    },
    // 为资产类型下拉框赋值
    findType: function() {
        this.findByTypeCode("10005",this.setType)
    },
    // 查询资产类型下拉框数据成功后的回调
    setType: function(isSuccess,json) {
        try{
            if (isSuccess) {
                this.typeData = [];
                for (var i = 0; i < json.data.length; i++) {
                    this.typeData.push(json.data[i]);
                }
            }
            else {
                this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
            }
        }
        catch(e){
            alert(e);
        }
    },
    // 为状态下拉框赋值
    findEnables: function() {
        this.findByTypeCode("10001",this.setEnables)
    },
    // 查询状态下拉框数据成功后的回调
    setEnables: function(isSuccess,json) {
        try{
            if (isSuccess) {
                this.enables = [];
                for (var i = 0; i < json.data.length; i++) {
                    this.enables.push(json.data[i]);
                }
            }
            else {
                this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
            }
        }
        catch(e){
            alert(e);
        }
    },
    // 为资产状态下拉框赋值
    findApprovalStatus: function() {
        this.findByTypeCode("10007",this.setApprovalStatus)
    },
    // 查询资产状态下拉框数据成功后的回调
    setApprovalStatus: function(isSuccess,json) {
        try{
            if (isSuccess) {
                this.ApprovalStatus = [];
                for (var i = 0; i < json.data.length; i++) {
                    this.ApprovalStatus.push(json.data[i]);
                }
            }
            else {
                this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
            }
        }
        catch(e){
            alert(e);
        }
    },
    // 为资产来源下拉框赋值
    findSource:function(){
        var queryRequest = {
                className: "com.ispr.iptv.entity.sys.SpeArea",//修改为被查询的实体地址
                opKey: "SpeArea",//后台编写相应的接口实现方法，主要负责转化类型
                params: [{key: 'isEnable',op: '=',val: 'Available'}],
                userInfo: this.getUserInfo()
            };
            var _this = this;
            this.axios.post('/api/speArea/query', queryRequest, {headers: this.headersObj})//findAllValueType修改为query
                .then(function(res) {
                    // alert(JSON.stringify(res));
                    // alert(res.data.code);
                    if (res.data.code == "SUCCESS") {
                        _this.source = [];
                        for (var i = 0; i < res.data.data.length; i++) {
                            _this.source.push(res.data.data[i]);
                        }
                    } else {
                        // this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
                    }
                })
                .catch(function(error) {
                    console.log(error);
                    // this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
                });
    },
    // 为播出状态下拉框赋值
    findBroadcastStatus: function() {
        this.findByTypeCode("10009",this.setBroadcastStatus)
    },
    // 查询播出状态下拉框数据成功后的回调
    setBroadcastStatus: function(isSuccess,json) {
        try{
            if (isSuccess) {
                this.BroadcastStatus = [];
                for (var i = 0; i < json.data.length; i++) {
                    this.BroadcastStatus.push(json.data[i]);
                }
            }
            else {
                this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
            }
        }
        catch(e){
            alert(e);
        }
    },
    // 为是否免费下拉框赋值
    findIsFeeData: function() {
        this.findByTypeCode("10020",this.setIsFeeData)
    },
    // 查询是否免费下拉框数据成功后的回调
    setIsFeeData: function(isSuccess,json) {
        try{
            if (isSuccess) {
                this.isFeeData = [];
                for (var i = 0; i < json.data.length; i++) {
                    this.isFeeData.push(json.data[i]);
                }
            }
            else {
                this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
            }
        }
        catch(e){
            alert(e);
        }
    },
    // 为版本下拉框赋值
    findProTypeData: function() {
        this.findByTypeCode("10017",this.setProTypeData)
    },
    // 查询版本下拉框数据成功后的回调
    setProTypeData: function(isSuccess,json) {
        try{
            if (isSuccess) {
                this.proTypeData = [];
                for (var i = 0; i < json.data.length; i++) {
                    this.proTypeData.push(json.data[i]);
                }
            }
            else {
                this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
            }
        }
        catch(e){
            alert(e);
        }
    },
    // 为内容类型下拉框赋值
    findContentTypeData: function() {
        this.findByTypeCode("10019",this.setContentTypeData)
    },
    // 查询内容类型下拉框数据成功后的回调
    setContentTypeData: function(isSuccess,json) {
        try{
            if (isSuccess) {
                this.contentTypeData = [];
                for (var i = 0; i < json.data.length; i++) {
                    this.contentTypeData.push(json.data[i]);
                }
            }
            else {
                this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
            }
        }
        catch(e){
            alert(e);
        }
    },
    // 为年龄段下拉框赋值
    findAgeGroupData: function() {
        this.findByTypeCode("10018",this.setAgeGroupData)
    },
    // 查询年龄段下拉框数据成功后的回调
    setAgeGroupData: function(isSuccess,json) {
        try{
            if (isSuccess) {
                this.ageGroupData = [];
                for (var i = 0; i < json.data.length; i++) {
                    this.ageGroupData.push(json.data[i]);
                }
            }
            else {
                this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
            }
        }
        catch(e){
            alert(e);
        }
    },
    // 为地区下拉框赋值
    findArea: function() {
        this.findByTypeCode("10010",this.setArea)
    },
    // 查询地区下拉框数据成功后的回调
    setArea: function(isSuccess,json) {
        try{
            if (isSuccess) {
                this.area = [];
                for (var i = 0; i < json.data.length; i++) {
                    this.area.push(json.data[i]);
                }
            }
            else {
                this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
            }
        }
        catch(e){
            alert(e);
        }
    },
    // 为语言下拉框赋值
    findLanguage: function() {
        this.findByTypeCode("10004",this.setLanguage)
    },
    // 查询地区下拉框数据成功后的回调
    setLanguage: function(isSuccess,json) {
        try{
            if (isSuccess) {
                this.Language = [];
                for (var i = 0; i < json.data.length; i++) {
                    this.Language.push(json.data[i]);
                }
            }
            else {
                this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
            }
        }
        catch(e){
            alert(e);
        }
    },
    //为资产提供商下拉框赋值
    findAssetProvision:function(){
        var queryRequest = {
                className: "com.ispr.iptv.entity.sys.SysProvider",//修改为被查询的实体地址
                opKey: "Provider",//后台编写相应的接口实现方法，主要负责转化类型
                params: [{key: 'isEnable',op: '=',val: 'Available'}],
                userInfo: this.getUserInfo()
            };
            var _this = this;
            this.axios.post('/api/query', queryRequest, {headers: this.headersObj})//findAllValueType修改为query
                .then(function(res) {
                    // alert(JSON.stringify(res));
                    // alert(res.data.code);
                    if (res.data.code == "SUCCESS") {
                        _this.AssetProvision = [];
                        for (var i = 0; i < res.data.data.length; i++) {
                            _this.AssetProvision.push(res.data.data[i]);
                        }
                    } else {
                        // this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
                    }
                })
                .catch(function(error) {
                    console.log(error);
                    // this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
                });
    },
    //为标签下拉框赋值
    findLabelGroups:function(){
        var queryRequest = {
                className: "com.ispr.iptv.entity.media.SysTagEntity",//修改为被查询的实体地址
                opKey: "LabelGroup",//后台编写相应的接口实现方法，主要负责转化类型
                params: [{key: 'isEnable',op: '=',val: 'Available'}],
                userInfo: this.getUserInfo()
            };
            var _this = this;
            this.axios.post('/api/query', queryRequest, {headers: this.headersObj})//findAllValueType修改为query
                .then(function(res) {
                    // alert(JSON.stringify(res));
                    // alert(res.data.code);
                    if (res.data.code == "SUCCESS") {
                        _this.LabelGroups = [];
                        for (var i = 0; i < res.data.data.length; i++) {
                            _this.LabelGroups.push(res.data.data[i]);
                        }
                    } else {
                        // this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
                    }
                })
                .catch(function(error) {
                    console.log(error);
                    // this.$message.error(this.$i18n.t("errorCode." + json.reason,json.message));
                });
    },
    //批量删除
    handleSelectionChange(val) {
        this.tableChecked = val
      },
    //监听子组件传回来的值
    ShellAssets:function(data, isShowChoose, opt){
       //alert(JSON.stringify(data));
    //    debugger
    //   this.transmitData = data;
      this.isShowChoose = isShowChoose;
      var actor = "";
      var actorId = [];
      data.forEach(element =>{
            var A = "";
            var B = "";
            A = element.actorName;
            B = element.actorId;
            if(actor == ""){
                actor = A;
                actorId.push(B);
            }else{
                actor = actor+","+ A;
                actorId.push(B);
            }
        })
        let tempActor = [];
        data.forEach(element =>{
            tempActor.push({"keyId":element.actorId,"actorName":element.actorName});
        });
        // Actor演员
        if(opt=="Actor"){
            this.editForm.actorList = actorId;
            // this.actorIsName = actor;
            this.editForm.actor = actor;
            //传递给演员数组用于回显数据
            this.transmitData = tempActor;
            // this.$refs.actor.focus();
            // this.$refs.actor.blur();
        }else if(opt == "Director"){ // Director导演
            this.editForm.directorList = actorId;
            // this.directorName = actor;
            this.editForm.director = actor;
            //传递给导演数组用于回显数据
            this.transmitDataDirector = tempActor;
            // this.$refs.director.focus();
            // this.$refs.director.blur();
        }else if(opt == "Screenwriter"){ // Screenwriter编剧
            this.editForm.editList = actorId;
            // this.editName = actor;
            this.editForm.edit = actor;
            //传递给导演数组用于回显数据
            this.transmitScreenwriter = tempActor;
            // this.$refs.edit.focus();
            // this.$refs.edit.blur();
        }
        this.isShowChoose = false;
    },
    //跳转到资产分类选择标签
    chooseCapital: function(){
        if(this.isShowCapitalChoose != true){
        // alert(123);
        let _this = this;
        this.isShowCapitalChoose = true;
        let keys = this.editForm.capitalList;
        this.checkedKeys = keys;
        // this.$refs.chooseCapital.queryTable();
        // this.$refs.chooseCapital.renderTree();
        setTimeout(function(){
            //console.log('keys===============>',keys)
            //_this.$refs.chooseCapital.$refs.tree.setCheckedKeys(keys);
            //this.$refs.chooseCapital.$refs.tree.setCheckedNodes([]);
            _this.$refs.chooseCapital.queryTreeData(keys);
        },100);
        // this.$refs.chooseCapital.$refs.tree.setCheckedNodes([]);
        }
    },
    //跳转到选择标签页面
    chooseTag: function(){
        // alert(123);
        this.option = {isClear:"true",transmitDataLabel:this.transmitDataLabel};
        this.isShowTagChoose = true;
        // console.log('this.transmitDataLabel===============>',this.transmitDataLabel)
        this.$refs.chooseTag.transmitData(this.transmitDataLabel);
        this.$refs.chooseTag.onReset();
        this.$refs.chooseTag.onQuery();

    },
    // 关闭执行清除多余数据的操作
    // closeDialog: function(){
    //     debugger
    //     let tempLabel= this.transmitDataLabel;
        // if(this.transmitDataLabel.length > 0){
        //     for(let i = 0; i<tempLabel.length;i++){
        //         var arr = Object.keys(tempLabel[i]);
        //         if(arr.length !== 2){
        //             this.transmitDataLabel.splice(i, 1);
        //         }
        //     }
        // }
    // },
    //监听标签组件传回来的值
    linkToTag: function(data,isShowChoose){
        // console.info("标签组件传回来的值===>"+JSON.stringify(data));
        this.isShowTagChoose = isShowChoose;
        let tagName = "";
        let tagId = [];

        data.forEach(element =>{
            if(tagName==""){
                tagName = element.tagName;
                tagId.push(element.tagId);
            }else{
                tagName = tagName+","+element.tagName;
                tagId.push(element.tagId);
            }
        });
        let transmitDataLabelTemp = [];
        data.forEach(element =>{
            transmitDataLabelTemp.push({"keyId":element.tagId,"tagName":element.tagName});
        });
        this.transmitDataLabel = transmitDataLabelTemp;
        this.editForm.tagNameAll = tagName;
        this.editForm.tagList = tagId;
    },

    //监听分类组件传回来的值
    linkToCapital: function(data,isShowChoose){

        //console.info("分类组件传回来的值===>"+JSON.stringify(data));
        this.isShowCapitalChoose = isShowChoose;
        let capitalName = "";
        let capitalId = [];
        data.forEach(element =>{
            if(capitalName==""){
                capitalName = element.label;
                capitalId.push(element.id);
            }else{
                capitalName = capitalName+","+element.label;
                capitalId.push(element.id);
            }
        });
        this.editForm.capitalNameAll = capitalName;
        this.editForm.capitalList = capitalId;
    },

    //单个下发删除
    onSendDel: function(index, row,rescode) {
        this.currentResCode = (rescode && rescode!=='') ? rescode : '';
        this.commandArgs = "DELETE";
        this.sendForm.sendType = "single";
        this.singleSend = {};
        let keyId = row.keyId;
        let version = row.version;
        let sendtoState = "DownAlready";
        let data = {"keyId":keyId,"version":version,"sendtoState":sendtoState};
        this.singleSend = data;
        //this.isShowEditForm2 = true;
        this.comfirmSend('sendForm',rescode);
    },

    //单个下发更新
    onSendUpdate: function(index, row,rescode) {
        this.currentResCode = (rescode && rescode!=='') ? rescode : '';
        this.commandArgs = "UPDATE";
        this.sendForm.sendType = "single";
        this.singleSend = {};
        let keyId = row.keyId;
        let version = row.version;
        let sendtoState = "DownAlready";
        let data = {"keyId":keyId,"version":version,"sendtoState":sendtoState};
        this.singleSend = data;
        //this.isShowEditForm2 = true;
        this.comfirmSend('sendForm',rescode);
    },
    // 提交下发界面数据
    comfirmSend: function (formName, rescode){
            this.currentResCode = (rescode && rescode!=='') ? rescode : '';

        var _this = this;
        let dataList = [];//最终传给后台的总数据
        let siteListJson = [];//站点的数据
        // for (let i=0;i<this.sendForm.siteList.length;i++){
        //     let siteId = this.sendForm.siteList[i];
        //     let resType = "A";
        //     let state = "DownAlready";
        //     let data = {"siteId":siteId,"resType":resType,"state":state};
        //     siteListJson.push(data);
        // };
        let resType = "A";
        let state = "DownAlready";
        let data = {"siteId":"bc83ec97-9ff6-47f0-b704-43b867108cee","resType":resType,"state":state};
        siteListJson.push(data);
        if(this.sendForm.sendType=="batch"){
            for(let i=0;i<this.multipleSelection.length;i++){
                let temp = this.multipleSelection[i];
                temp.siteList = siteListJson;
                dataList.push(temp);
            }
        }else if(this.sendForm.sendType=="single"){
            this.singleSend.siteList = siteListJson;
            dataList.push(this.singleSend);
        }
        this.$confirm(this.$i18n.t("message.confirmSendMessage"),
            this.$i18n.t("message.confirmTitle"), {
            confirmButtonText: this.$i18n.t("message.yes"),
            cancelButtonText: this.$i18n.t("message.cancel"),
            type: "warning",
            callback: function (action, instance) {
                if (action == "confirm") {
                    _this.loading = true;
                    _this.procCommand("MediaToCdnProc",//MediaSendToProc
                    _this.modelName,
                    _this.commandArgs,//操作类型 注册一REGIST 更新一UPDATE 删除一DELETE
                    {
                        "dataList":dataList,
                    },
                    null,
                    _this.comfirmSendCallback);
                } 
            }
        });
    },
    // 执行命令后的回调函数
    comfirmSendCallback: function (isSuccess,json) {

        this.loading = false;
        if(isSuccess){
            this.isShowEditForm2 = false;
            this.$message({
                message: this.$i18n.t("message.successTip"),//resource.message.successTip,
                type: 'success'
            });
            this.queryTable();
        }
        else
        {
            this.$message.error(this.$i18n.t(json.msg));
            // this.$message({
            //                 message: this.$i18n.t("errorCode." + json.reason),
            //                 type: 'warning'
            //                 });

        }
    },

    //资产名称自动生成全拼
    setLetterSimplify:function(){
        let pinyin = chineseToPinYin(this.editForm.assetName);
        let ss = "";
        for (let i = 0; i < pinyin.length; i++) {
            if((pinyin.substring(i,i+1) >= 'A' && pinyin.substring(i,i+1) <= 'Z') ||(pinyin.substring(i,i+1) >= '0' && pinyin.substring(i,i+1) <= '9')) {
                ss += pinyin.substring(i,i+1);
            }
        }
        this.editForm.letterSimplify = chineseToPinYin(ss);
    },
    initTable:function(){
        //alert("setTimeout");
        this.tableHeight = this.$refs.context.offsetHeight - this.$refs.queryBox.offsetHeight;
        this.isInit = true;
    },
    enterDown(){
      var g = this
      if(g.isShowEditForm){
        g.submitUpload('editForm',g.currentResCode)
      // }else if(){
      //   g.submitForm('editForm',g.currentResCode)
      }else if(!g.loading){
        g.onQuery()
      }
    }

  },
  mounted: function mounted() {
    this.findSort();
    this.findType();
    this.findEnables();
    this.findApprovalStatus();
    this.findSource();
    this.findAssetProvision();
    this.findBroadcastStatus();
    this.findArea();
    this.findLabelGroups();
    this.findLanguage();
    this.findIsFeeData(); //查询是否免费数据字典
    this.findProTypeData();//查询版本数据字典
    this.findContentTypeData();//查询内容类型数据字典
    this.findAgeGroupData();//查询年龄段数据字典
    // this.formQueryCondition.isEnable.val = "";
    this.onQuery();
    window.setTimeout(this.initTable,100);
  },
  components: {
    "assets-info": assetsInfo,
    "actor-info": actorTwo,
    "audit-record": auditRecord,
    "tag-choose": tagChoose,
    "capital-choose": capitalChoose,
    'upload-file': () => import('./UploadFile'),
  }
}


</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.separateStyle{
    margin-left: 25px;
}
.avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }
  .avatar {
    width: 178px;
    height: 178px;
    display: block;
  }
</style>
